package model.tests;

import java.awt.Color;
import java.awt.Graphics;
import util.Pixmap;
import model.turtle.Commandable;


public class CommandableTester implements Commandable {

    private boolean moveCalled;
    private boolean paintCalled;
    private boolean rotateCalled;
    private boolean setHeadingCalled;
    private boolean setPositionCalled;
    private boolean setPenUpCalled;
    private boolean setPenDownCalled;
    private boolean makeVisibleCalled;
    private boolean makeInvisibleCalled;
    private boolean resetCalled;

    private int moveValue;
    private int rotateValue;
    private int headingValue;
    private int positionXValue;
    private int positionYValue;

    public CommandableTester() {
        resetCalls();
    }

    public void resetCalls() {
        setMoveCalled(false);
        setPaintCalled(false);
        setRotateCalled(false);
        setSetHeadingCalled(false);
        setSetPositionCalled(false);
        setSetPenUpCalled(false);
        setSetPenDownCalled(false);
        setMakeVisibleCalled(false);
        setMakeInvisibleCalled(false);
        setResetCalled(false);
        setMoveValue(0);
        setRotateValue(0);
        setHeadingValue(0);
        setPositionXValue(0);
        setPositionYValue(0);
    }

    @Override
    public int move(int pixels) {
        setMoveValue(pixels);
        setMoveCalled(true);
        return pixels;
    }

    @Override
    public int paint(Graphics pen) {
        setPaintCalled(true);
        return 1;
    }

    @Override
    public int rotate(int degrees) {
        setRotateValue(degrees);
        setRotateCalled(true);
        return degrees;
    }

    @Override
    public int setHeading(int heading) {
        setHeadingValue(heading);
        setSetHeadingCalled(true);
        return heading;
    }

    @Override
    public int setPosition(int x, int y) {
        setPositionXValue(x);
        setPositionYValue(y);
        setSetPositionCalled(true);
        return 1;
    }

    @Override
    public int setPenUp() {
        setSetPenUpCalled(true);
        return 0;
    }

    @Override
    public int setPenDown() {
        setSetPenDownCalled(true);
        return 1;
    }

    @Override
    public int makeVisible() {
        setMakeVisibleCalled(true);
        return 1;
    }

    @Override
    public int makeInvisible() {
        setMakeInvisibleCalled(true);
        return 0;
    }

    @Override
    public void clear() {
        setResetCalled(true);
    }

    @Override
    public int getXCoordinate() {
        return positionXValue;
    }

    @Override
    public int getYCoordinate() {
        return positionYValue;
    }

    @Override
    public int getHeading() {
        return headingValue;
    }

    public void addObserver(Object o) {
        
    }

    /*
     * Getters and Setters
     */

    public boolean isMoveCalled() {
        return moveCalled;
    }

    public void setMoveCalled(boolean moveCalled) {
        this.moveCalled = moveCalled;
    }

    public boolean isPaintCalled() {
        return paintCalled;
    }

    public void setPaintCalled(boolean paintCalled) {
        this.paintCalled = paintCalled;
    }

    public boolean isRotateCalled() {
        return rotateCalled;
    }

    public void setRotateCalled(boolean rotateCalled) {
        this.rotateCalled = rotateCalled;
    }

    public boolean isSetHeadingCalled() {
        return setHeadingCalled;
    }

    public void setSetHeadingCalled(boolean setHeadingCalled) {
        this.setHeadingCalled = setHeadingCalled;
    }

    public boolean isSetPositionCalled() {
        return setPositionCalled;
    }

    public void setSetPositionCalled(boolean setPositionCalled) {
        this.setPositionCalled = setPositionCalled;
    }

    public boolean isSetPenUpCalled() {
        return setPenUpCalled;
    }

    public void setSetPenUpCalled(boolean setPenUpCalled) {
        this.setPenUpCalled = setPenUpCalled;
    }

    public boolean isSetPenDownCalled() {
        return setPenDownCalled;
    }

    public void setSetPenDownCalled(boolean setPenDownCalled) {
        this.setPenDownCalled = setPenDownCalled;
    }

    public boolean isMakeVisibleCalled() {
        return makeVisibleCalled;
    }

    public void setMakeVisibleCalled(boolean makeVisibleCalled) {
        this.makeVisibleCalled = makeVisibleCalled;
    }

    public boolean isMakeInvisibleCalled() {
        return makeInvisibleCalled;
    }

    public void setMakeInvisibleCalled(boolean makeInvisibleCalled) {
        this.makeInvisibleCalled = makeInvisibleCalled;
    }

    public boolean isResetCalled() {
        return resetCalled;
    }

    public void setResetCalled(boolean resetCalled) {
        this.resetCalled = resetCalled;
    }

    public int getMoveValue() {
        return moveValue;
    }

    public void setMoveValue(int moveValue) {
        this.moveValue = moveValue;
    }

    public int getRotateValue() {
        return rotateValue;
    }

    public void setRotateValue(int rotateValue) {
        this.rotateValue = rotateValue;
    }

    public int getHeadingValue() {
        return headingValue;
    }

    public void setHeadingValue(int headingValue) {
        this.headingValue = headingValue;
    }

    public int getPositionXValue() {
        return positionXValue;
    }

    public void setPositionXValue(int positionXValue) {
        this.positionXValue = positionXValue;
    }

    public int getPositionYValue() {
        return positionYValue;
    }

    public void setPositionYValue(int positionYValue) {
        this.positionYValue = positionYValue;
    }

    @Override
    public int clearStamps () {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int getID () {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public Pixmap getImage () {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public int getPenColor () {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int getPenState () {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int getVisibility () {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int isActive () {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int paintHighlight (Graphics pen) {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int setActiveState (boolean state) {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int setTowards (int x, int y) {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int setImage (Pixmap image) {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int setPenColor (Color c) {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int setPenDesign (String design) {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int setPenSize (int width) {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int stamp () {
        // TODO Auto-generated method stub
        return 0;
    }

}
